<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>需求分配数据展示系统</title>
  <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">需求分配数据分析系统</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">实时数据分析</a></li>
<!--      <li class="layui-nav-item"><a href="javascript:refreshPart('layui-side-scroll', 'advanced_left.html')">历史数据分析</a></li>-->
      <li class="layui-nav-item"><a href="javascript:refreshPart('layui-body', 'real_time_motion.html')">需求分配实时演示</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          Xi Yu
        </a>
      </li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">实时指标</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:refreshPart('layui-body', 'real_time_performance.html')">概览</a></dd>
            <dd><a href="javascript:refreshPart('layui-body', 'real_time_success_rate.html')">成交率</a></dd>
<!--            <dd><a href="javascript:refreshPart('layui-body', 'real_time_cancellation_rate.html');">失效率</a></dd>-->
            <dd><a href="javascript:refreshPart('layui-body', 'real_time_answer_time.html');">应答时间</a></dd>
          </dl>
        </li>
<!--        <li class="layui-nav-item">-->
<!--          <a href="javascript:;">供需数据分析</a>-->
<!--          <dl class="layui-nav-child">-->
<!--            <dd><a href="javascript:refreshPart('layui-body', 'real_time_demand_hot_area.html');">实时需求分布热力图</a></dd>-->
<!--            <dd><a href="javascript:refreshPart('layui-body', 'real_time_supplier_hot_area.html');">实时服务提供者分布热力图</a></dd>-->
<!--            <dd><a href="javascript:refreshPart('layui-body', 'real_time_gap.html');">实时供需平衡</a></dd>-->
<!--          </dl>-->
<!--        </li>-->
      </ul>
    </div>
  </div>
  
  <div class="layui-body">
  </div>
  <div class="layui-footer">
    开发版
  </div>
</div>
<script src="layui/layui.js"></script>
<script src="layui/lay/modules/jquery.js"></script>
<script src="js/echarts.min.js"></script>
<script>
  var timerIds = [];
  var ws = undefined;
  function refreshPart(containerClassName, pageName){
    for (var i = 0; i < timerIds.length; i++) {
      clearInterval(timerIds[i]);
    }
    timerIds.splice(0, timerIds.length);
    if (ws != undefined) {
      ws.close();
    }
    layui.$.ajax({
        type : "get",
        async : false,  //同步请求
        url : pageName,
        success:function(data){
          layui.$("." + containerClassName ).html(data);//要刷新的div
          console.log("success")
        },
        error: function() {
          //layui 弹出层
        }
    })
  }
  refreshPart("layui-body", "real_time_motion.html")
</script>

<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
});
</script>
</body>
</html>